AkpScript
Previous   Top   Next

Akp script is a script based on Pascal / Delphi format.
 
This script support is based on Pascal Script 3.0 , it support most pascal syntax like variables, decision, looping, thus it can provide more customization if compare with aks script.
 
Quick Zip 4.00 allow you to use the CAKE2 component (TCakdir2), following is an example of how to use this object.
 

--------------------------------------------------------------------------------
program Test;
var Cakdir2 : TCakdir2;
          Contents : ContentType;
          i : integer;
begin
    Cakdir2 := TCakdir2.Create(nil);
    Cakdir2.Archivename := 'C:\4_0rev1.zip';
    if Cakdir2.Total_Contents > 0 then
        for i := 0 to Cakdir2.Total_Contents -1 do
            begin
              Contents := Cakdir2.Archive_Contents(i);
              begin
                Writeln(Contents._Filename);
                Writeln(DateTimeToStr(Contents._FileTime));
              end;
            end;
            if Cakdir2.Cando('xyz.zip',wtLoadContents) then
                Writeln('yes');
            Cakdir2.HotEdit('Image1.jpg');
    Cakdir2.free;
end.
--------------------------------------------------------------------------------
 
TCakdir2 object can be found here , please note that due to some limitation, record type in Cakdir2 (e.g. Archive_Contents, ExtractOptions and AddOptions) must be assigned to variable when use, instead of calling directly.
 
 
Below is a list of functions that available since Quick Zip 3.00, detail list please check here

functions
Description
function sizeinK(size: integer): string;
Change numeric size into kbe.g. sizeinK(112640) will result 112.64kb
function Param : Tstrings;
File selected in shell context menuFor use with context menu script only!e.g.for i := 0 to ParamCount -1 do Writeln(param.strings[i];
procedure New(name : string);
Create new archivee.g. New('c:\new archive.zip');
procedure Open(name : string);
Open existing archivee.g. Open('c:\another archive.zip');
procedure Close;
Close archivee.g. Close;
procedure Test;
Test archive;e.g. Test;
procedure Extract(what, too : string)
Extract all or selected filese.g.Open('c:\anarchive.zip');Useextrpath(True);Useextroverwrite(True);Extract('*.jpg','c:\dir1');
procedure Add(name : string);
Add filee.g.New('c:\a new archive.zip');UseSubdir(True);Add('c:\temp\*.*');Add('c:\xyz.log');DoAdd;
procedure DoAdd;
Start add filese.g. Doadd;
procedure Del(what : string);
Delete files in an archivee.g.Open('c:\anarchive.zip');Del('xyz.txt');Close;
procedure Ren(what,too : string);
Rename file in a zip file (zip only!)e.g. Ren('a.txt','b.txt');
procedure Convert(what,totype : string);
Convert an archive to another type.Warning! Directory structure is removed when converte.g.Convert('c:\arctoconvert.zip','CAB');
procedure Password(what : string);
Specify password for extract and add.e.g. Password('your password');
procedure UseVerCtrl(toggle : boolean);
procedure Useextrpath(toggle : boolean);
procedure Useextroverwrite(toggle : boolean);
procedure Useaddpath(toggle : boolean);
procedure Userelativepath(toggle : boolean);
procedure Usesubdir(toggle : boolean);
procedure RunFile(what : string);
procedure MoveFile(what, too : string);
procedure RenFile(what, too : string);
procedure DelFile(what : string);
procedure CopyFile(what,too : string);
procedure MakeDir(what : string);
procedure DelDir(what : string);
procedure Sort(index : integer; accending : boolean);
procedure OpenDir(what : string);
function Total_Contents : integer;
function Contents_Filename(which : integer) : String;
unction Contents_FileDefPath(which : integer) : String;
function Contents_FileSize(which : integer) : Integer;
function Contents_FileCompSize(which : integer) : Integer;
function Contents_FileSelected(which : integer) : Boolean;
function Contents_FileType(which : integer) : String;
function Contents_FileDateTime(which : integer) : TDatetime;
procedure Select_File(which : integer);
procedure DeSelect_File(which : integer);
function Mask_Select_File(mask : string) : integer
procedure Clear_select;
function TempPath : String;
function MydocuPath : string;
function DesktopPath : string;
function SystemPath : string;
function ProgramPath : string;
function CurrentPath : string;